<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function func(value){
            value = value === undefined ? undefined :value;
            console.log(value);
        }
        func(8);
        func();


// 参数传入默认值，如果有默认值就按照默认值输出，
// 如果没有默认值就按照传入的参数输出
        function func(value=5){
            // 三元表达式
            value = value === undefined ? undefined :value;
            console.log(value);
        }
        func(8);
        func();

    </script>
</body>
</html>